<template>
  <div class="posfix fs10 bradius5 ca8 textc floats trans2 bottom30 right6 shadow_gray bgfff w50 pb15" :style="'bottom:' +bottom+'px'">
    <FormId>
      <div class="pt16" @click="page_turn('shopCart')">
        <img src="https://one-stand.oss-cn-shanghai.aliyuncs.com/yimai_photos/user/cart_gray.png" alt="" class="w24 h24">
        <p class="pt5">购物车</p>
      </div>
    </FormId>
    <FormId v-if="!isSelf">
      <div class="pt16 posre" @click="page_turn('IM')">
        <img src="https://one-stand.oss-cn-shanghai.aliyuncs.com/yimai_photos/user/msg_gray.png" alt="" class="w24 h24">
        <span class="right_point"></span>
<!--        <span class="right_point">-->
<!--          {{unreadNum}}-->
<!--        </span>-->
        <p class="pt5">咨询</p>
      </div>
    </FormId>
    <FormId>
      <div class="pt16" @click="page_turn('usercenter')">
        <img src="https://one-stand.oss-cn-shanghai.aliyuncs.com/yimai_photos/user/user_gray.png" alt="" class="w24 h24">
        <p class="pt5">我的</p>
      </div>
    </FormId>
  </div>

</template>

<script>
  import store from '../store/index';
  import FormId from '@/components/formId'
  import { mapGetters, mapActions } from 'vuex';
  import websocket from '@/utils/websocket'
  export default {
    name: "rightFloat",
    components: { FormId },
    props:{
      intoType: {
        type: [Number, String],
        default: 2,
      },
      specId: {
        type: [Number, String],
        default: '',
      },
      bottom:{
        type: String,
        default: '',
      }
    },
    onShow(){
      // websocket.sendMessage({
      //   code: 109,
      //   targetId: wx.getStorageSync,
      // })
    },

    methods:{
      page_turn(url){
        wx.navigateTo({url:'../'+url+'/main?type='+this.intoType
          +'&cardId='+this.currentCompany.cardId
          +'&userId='+this.currentCompany.userId
          +'&logo='+(this.currentCompany.logo || '')
          +'&wxCode='+(this.currentCompany.personalWx || '')
          +'&phone='+(this.currentCompany.phone || '')
          +'&specId='+(this.specId||'')
          +'&name='+(this.currentCompany.name || '')});
      }
    },
    computed:{
      ...mapGetters(['currentCompany', 'unreadNum']),
      isSelf(){
        return this.currentCompany.userId == wx.getStorageSync('userId');
      },
    }

  }
</script>

<style>
  .right_point{
    position: absolute;
    width: 10px;
    height: 10px;
    background: #FD634E;
    border-radius: 50%;
  }
  /*.right_point{*/
  /*  position: absolute;*/
  /*  min-width: 15px;*/
  /*  min-height: 15px;*/
  /*  background: #FD634E;*/
  /*  border-radius: 999px;*/
  /*  right: 6px;*/
  /*  top: 12px;*/
  /*  color: white;*/
  /*}*/
  .h0 .floats{
    height: 0;
    overflow: hidden;
    padding-bottom: 0;
  }
</style>




























